package com.lahuan.demo.controller;


import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lahuan.config.integration.RegisterMessageGateway;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import lombok.RequiredArgsConstructor;
import com.lahuan.common.Result;
import com.lahuan.demo.service.OrderService;
import com.lahuan.demo.entity.Order;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * <p>
 * 订单 控制器
 * </p>
 * @author lahuan
 * @since 2021-12-15
 */
@RequiredArgsConstructor
@RestController
@Slf4j
@Api(value = "t_order", tags = "订单接口")
@RequestMapping("/demo/order")
public class OrderController {

    @Autowired
    private RegisterMessageGateway registerMessageGateway;

    @ApiOperation(value = "发送",notes="发送")
    @PostMapping ("/register")
    public Result<Order> orderGetById(@RequestBody Order order) {
        registerMessageGateway.registerMessageFlow(order);
        return Result.ok(null,"success");
    }



}
